﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.MultiUserAdminPageBase" %>
<ali:Get ID="Position" Object="Position" InnerID="Request.QueryString['ID']" Validate="True" />
<script language="c#" runat="server">
protected string IsPublic
{
	get
	{
		if (Position[Alias.Position.SubInstanceID].ToString() == Guid.Empty.ToString())
			return " disabled";
		else
			return "";
	}
}
</script>
<section data-page="position_edit" data-title="编辑广告" data-id="<%=Position[InnerID]%>" data-guid="<%=Position[ID]%>">
	<div class="path1"><span>您的位置：</span><a href="list.aspx" target="ali-navtab">广告列表</a> → <b class="<%=ContentLang%>Font"><%=Position[Name]%></b></div>
	<form action="" class="post">
		<div class="post-body">
			<table class="post-table">
				<tr>
					<th>广告位名称：</th>
					<td><input type="text" name="Name" value="<%=Position[Name]%>" size="40" maxlength="255" class="ali-input ali-input-required <%=ContentLang%>Font"<%=IsPublic%>></td>
				</tr>
				<tr>
					<th>广告类型：</th>
					<td>
						<select name="TypeID" class="<%=ContentLang%>Font"<%=IsPublic%>>
							<ali:List Object="Type">
								<ali:Record>
									<%If Guid.Equals(ID, Position[TypeID])%>
										<option value="<%=ID%>" selected><%=Name%></option>
									<%Else%>
										<option value="<%=ID%>"><%=Name%></option>
									<%EndIf%>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>尺寸：</th>
					<td>
						宽：<input type="text" name="Width" value="<%=Position[Width]%>" size="10" maxlength="10" class="Text"<%=IsPublic%>>px，
						高：<input type="text" name="Height" value="<%=Position[Height]%>" size="10" maxlength="10" class="Text"<%=IsPublic%>>px
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<table class="sub-list-table">
							<thead>
								<tr>
									<th>标题</th>
									<th>图片</th>
									<th>网址</th>
									<th>代码</th>
									<th>删除</th>
								</tr>
							</thead>
							<tbody>
								<ali:List Object="Ad" Condition="IsDeleted=false and IsChecked=true and PositionID=Position[ID]" Validate="True">
									<ali:Record>
										<tr data-id="<%=InnerID%>">
											<td><input type="text" value="<%=Title%>" size="20" class="ali-input <%=ContentLang%>Font"></td>
											<td nowrap><input type="text" value="<%=Image%>" size="20" class="ali-input"><a class="ali-button ali-uploader">浏览...</a></td>
											<td><input type="text" value="<%=URL%>" size="20" class="ali-input"></td>
											<td><textarea rows="1" cols="30" class="ali-input"><%=HttpUtility.HtmlEncode(Convert.ToString(Code))%></textarea></td>
											<td style="text-align:center"><a class="ali-button" data-operation="delete">删除</a></td>
										</tr>
									</ali:Record>
								</ali:List>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="5"><a class="ali-button" data-operation="addAd">增加</a></td>
								</tr>
							</tfoot>
						</table>
					</td>
				</tr>
			</table>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
	</form>
</section>